package papers;

/**
 * A paper written on a Manuscript.
 * 
 * @author Matt Minch
 * @author Dickson Kwong - updated setSubmissionDate method
 */
import java.io.File;
import java.util.Date;

import users.Reviewer;

public class Review {
	
	private Reviewer my_Reviewer;
	private Date my_SubmissionDate;
	private File my_Review;
	
	/**
	 * Creates a Review object.
	 * 
	 * @param user the Reviewer who wrote the review.
	 * @param date the Date that the review is turned in.
	 * @param review the file holding the review.
	 * @param rating the rating the reviewer gives the manuscript he reviewed.
	 */
	public Review(Reviewer user, Date date, File review) {
		my_Reviewer = user;
		my_SubmissionDate = date;
		this.my_Review = review;
	}
	
	/**
	 * Gets the actual review file.
	 * 
	 * @return myReview, the review file.
	 */
	public File getReview(){
		return my_Review;
	}
	
	/**
	 * Allows a reviewer to change the review he/she gives of a manuscript.
	 * 
	 * @param newReview the Review that myReview is being changed to.
	 */
	public void setReview(File newReview) {
		my_Review = newReview;
		setSubmissionDate(new Date());
	}	
	
	/**
	 * Gets the date that the review was submitted.
	 * 
	 * @return mySubmissionDate, the date the review was submitted.
	 */
	public Date getSubmissionDate(){
		return my_SubmissionDate;
	}
	
	/**
	 * Sets the submission date in the case the review has been resubmitted.
	 * 
	 * @param newDate the date that the submission date is to be changed to.
	 */
	private void setSubmissionDate(Date newDate) {
		my_SubmissionDate = newDate;
	}
	
	/**
	 * Gets the person who wrote the review.
	 * 
	 * @return myReviewer, the person who wrote the review.
	 */
	public Reviewer getUser(){
		return my_Reviewer;
	}
	
}
